<p>Lookahead assertions are a regex feature that makes it possible to look ahead in the input without consuming it. It is often used at the end of
regular expressions to make sure that substrings only match when they are followed by a specific pattern.</p>
<p>However, they can also be used in the middle (or at the beginning) of a regex. In that case there is the possibility that what comes after the
lookahead does not match the pattern inside the lookahead. This makes the lookahead impossible to match and is a sign that there’s a mistake in the
regular expression that should be fixed.</p>
<h2>Noncompliant Code Example</h2>
<pre>
Pattern.compile("(?=a)b"); // Noncompliant, the same character can't be equal to 'a' and 'b' at the same time
</pre>
<h2>Compliant Solution</h2>
<pre>
Pattern.compile("(?&lt;=a)b");
Pattern.compile("a(?=b)");
</pre>

